import { createRouter, createWebHistory, createMemoryHistory } from 'vue-router';

export default function () {
  const routerHistory = import.meta.env.SSR === false ? createWebHistory() : createMemoryHistory();

  return createRouter({
    history: routerHistory,
    routes: [
            {
              path:'/',
              redirect:'/index'
            },
            {
                path: '/index',
                name:'index',
                component: () => import('@/pages/index.vue')
            },
            {
                path:'/list',
                name:'list',
                component:() => import('@/pages/list.vue')
            }
        ]
  });
}
